import * as types from '../../constants/ActionTypes';

const initialState = {
    userId: '',
    message: '',
    token:''
};

export function userLogin(state = initialState, action) {
    switch (action.type) {
        case types.USER_LOGIN_SUCCESS:
            return {
                ...state,
                userName: action.userName,
                token:action.token
            }
        case types.USER_LOGIN_FAILURE:
            return {
                ...state,
                message: action.message
            }
        default:
            return state;
    }
}
